class Garen:#定义盖伦类
    def __init__(self, nick_name, life_value, aggresivity):
        self.nick_name = nick_name
        self.life_value = life_value
        self.aggresivity = aggresivity
    def attack(self, enemy):#盖伦的attack方法
        enemy.life_value -= self.aggresivity
class Timo:#定义提莫类
    def __init__(self, nick_name, life_value, aggresivity):
        self.nick_name = nick_name
        self.life_value = life_value
        self.aggresivity = aggresivity
    def attack(self, enemy):#提莫的attack方法
        enemy.life_value -= self.aggresivity
g1 = Garen('盖伦', 100, 30)
t1 = Timo('提莫', 80, 50)
while True:
    print("timo的生命值" , t1.life_value)
    g1.attack(t1)
    print("Garen进行了一次攻击" )
    if t1.life_value<0:
        print("Garen获胜")
        break

    print("Garen的生命值" , g1.life_value)
    t1.attack(g1)
    print("Timo进行了一次攻击")
    if g1.life_value < 0:
        print("Timo获胜")
        break


